package com.hhkj.payment.wechat.notification.common.processor;

import com.hhkj.payment.wechat.notification.common.parser.Parser;
import com.wechat.pay.java.core.notification.Notification;
import com.wechat.pay.java.service.refund.model.RefundNotification;

/**
 * RefundSuccessProcessor
 *
 * @author HHKJ-SERVER-ZJ
 * @since 2023/11/22 20:49
 */
public interface RefundSuccessProcessor extends Processor {

    /**
     * 处理对应数据
     *
     * @param notification 处理信息
     */
    default Object process(Notification notification, Parser parser) {
        RefundNotification refundNotification = parser.getDecryptObject(notification, RefundNotification.class);
        process(refundNotification);
        return refundNotification;
    }

    /**
     * 处理退款信息
     *
     * @param refundNotification 信息
     */
    void process(RefundNotification refundNotification);
}
